function Swiper(el){
    this.el=document.querySelector(el)
    this.num=1
    this.t=null
    this.ulLiObjs=this.el.querySelectorAll('ul li')
    this.init()
}
Swiper.prototype.init=function(){
    this.timeChange()
    this.pageOver()
    this.pageOut()
}

Swiper.prototype.timeChange=function(){
    
    this.t=setInterval(()=>{
        this.num++
        if(this.num>6) this.num=1
        this.pages(this.num)
    },2000)
}
Swiper.prototype.pageOver=function(){
    
    this.ulLiObjs.forEach((item,i)=>{
        item.onmouseover=()=>{
            clearInterval(this.t)
            this.num=i+1
            this.pages(this.num)
        }
    })
}
Swiper.prototype.pages=function(num){
    this.el.querySelector('img').src=`./imgs/img${num}.jpg`
    this.el.querySelector('ul li.active').className=''
    this.el.querySelector(`ul li:nth-of-type(${num})`).className='active'
}
Swiper.prototype.pageOut=function(){
    this.ulLiObjs.forEach((item,i)=>{
        item.onmouseout=()=>{
            this.timeChange()
        }
    })
}